package org.wattdepot.cli;

import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 * Tests All the list power options.
 * 
 * @author Aaron Herres
 * 
 */
public class TestListPower {
  CommandLineInterface cli;

  /**
   * Initialises class for testing.
   */
  @Before
  public void initializeCommandLineInterface() {
    cli = new CommandLineInterface("http://server.wattdepot.org:8182/wattdepot/");
  }
  
  /**
   * Tests the power generated function by timestamp.
   */
   @Test
   public void testPowerGeneratedTimestamp() {
     
     String message = 
       cli.processMainCommand("list power generated SIM_AES timestamp 2009-11-01T00:00:00.0000");
     System.out.println(message);
     Assert.assertNotNull(message);
   }
   /**
    * Tests the power consumed function by timestamp.
    */ 
   @Test
   public void testPowerConsumedTimestamp() {
     
     String message = 
       cli.processMainCommand("list power consumed SIM_AES timestamp 2009-11-01T00:00:00.0000");
     System.out.println(message);
     Assert.assertNotNull(message);
   }
   /**
    * Tests the power generated function by day/interval.
    */
   @Test
   public void testPowerGeneratedDay() {
   
     String message = 
       cli.processMainCommand("list power generated SIM_AES day 2009-11-01");
     System.out.println(message);
     Assert.assertNotNull(message);
   }
   /**
    * Tests the power consumed function by day/interval.
    */
   @Test
   public void testPowerConsumedDay() {
     
     String message = 
       cli.processMainCommand("list power consumed SIM_AES day 2009-11-01");
     System.out.println(message);
     Assert.assertNotNull(message);
   }
   
}
